#pragma once
#include <YSimpleNetwork/YSimpleNetwork.h>
#include <WinSock2.h>
#include <WS2tcpip.h>
#include <string>

namespace ysimple_network
{
	class YSIMPLENETWORK_EXPORTS_API YEndPoint
	{
		sockaddr_in	m_sockaddr;
		int				m_sockaddr_size;
		char			m_ip[32];
		WORD		m_port;
	public:
		YEndPoint();
		YEndPoint(const std::string& ip, WORD port);
		YEndPoint(const sockaddr_in& sockAddr);
		~YEndPoint(void);

		const SOCKADDR&	getAddressInfo() const;
		int					getAddressInfoSize() const;
		void				setAddressInfo(const std::string& ip, WORD port);

		friend std::ostream& operator<<(std::ostream& os, const YEndPoint& endPoint);
	};
	
	
}